home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
DO1002.ARJ
/
OPEN.SCR
< prev
next >
Wrap
Text File
|
1991-12-28
|
2KB
|
48 lines
.pg wi full clr cy
COMMAND NAME»gray«: »%t« OpenFile »ye«
/OPEN {handle} {filename} {mode} [{extension}] [{label}]
/cw
»%t«OpenFile»#« opens a »ye«TEXT file»#« for reading or writing.
»cy«{handle}»#« A file handle is a number between 1-10.
»cy«{filename}»#« The name of the file to be opened.
»cy«{mode}»#« How the file is to be opened:
»ye«W»gy« = »#«write
»ye«R »gy«= »#«read
»ye«A »gy«= »#«append
»cy«{extension}»#« An optional parameter indicating the file is to be
backed up before use to a file with the indicated
extension.
»cy«{label}»#« A label to jump to incase of an error opening the file.
If no label is included, an error causes the command to
jump to »gr«:OPENERROR»#«.
.pg clr
Here are some examples:
»cy«/OPEN 1 MYFILE.TXT W»#«
Open »ye«MYFILE.TXT»#« for writing. This will »re«delete»#« any
text in the file if it exists.
»cy«/OPEN 2 DOCUMENT.TXT A»#«
Open »ye«DOCUMENT.TXT»#« as file »ye«2»#« and append text to the
end of the file. This does »re«NOT»#« delete any existing
text. If the file does not exist, "»ye«A»#«" will function
exactly like "»gr«W»#«".
.pg cy
/OPEN 9 TEST.TXT W BAK»#«
Open »ye«TEST.TXT»#« for writing and clear all the text in
an existing file. But first, backup TEST.TXT to
»gr«TEST.BAK»#«.
»cy«/OPEN 3 BOOK.DOC R "" NoFile»#«
Open »ye«BOOK.DOC»#« for reading. Do not back it up. Jump
to the label "»cy«:NOFILE»#«" if the file is not successfully
opened.
/ENDEXEC